<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>传参控制盒子显示</title>
    <style>
        div{
            width: 200px;
            height: 200px;
            background-color: pink;
            margin: 20px;
            display: none;
        }
    </style>
    <script>
        function show(obj){
            var box = document.getElementById(obj);
            box.style.display = "block";
        }
    </script>
</head>
<body>
<button id="btn1" onclick="show('demo01');">按钮1</button>
<button id="btn2" onclick="show('demo02')">按钮2</button>
<button id="btn3" onclick="show('demo03')">按钮3</button>
<button id="btn4" onclick="show('demo04')">按钮4</button>
<div id="demo01">1</div>
<div id="demo02">2</div>
<div id="demo03">3</div>
<div id="demo04">4</div>
</body>
</html>